package com.tianlang.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.tianlang.domain.pojo.Authority;
import com.tianlang.security.tool.AcegiUtil;
import com.tianlang.service.IAuthorityManager;

@SuppressWarnings("unchecked")
@Service("authorityManager")
public class AuthorityManager extends BaseManager implements IAuthorityManager {

	@Override
	public Map<String, List<Authority>> loadAll() {
		List<Authority> list = super.getObjects(Authority.class);
		// 转换以请求路径为key的hash表，对应所有此路径访问权限的角色列表
		HashMap<String, List<Authority>> root = AcegiUtil.Transform(list);
		return root;
	}
}
